<template>
  <div>
    <div class = "banner" @click="handleBannerClick">
        <img class="banner-img" src="https://imgs.qunarzz.com/p/tts1/1612/ab/a482abb41f9ea202.jpg_r_390x260x90_12d2be57.jpg" />
        <div class="banner-info">
            <div class="banner-title">羊狮慕风景区</div>
            <div class="banner-number banner-icon"><span class="iconfont arrow-icon">&#xea92;</span>39</div>
        </div>
    </div>
    <fade-animation>
      <common-gallary :imgs="imgs"
        v-show="showGallary"
        @close="handleGallaryClose">
      </common-gallary>
    </fade-animation>
  </div>
</template>

<script>
import CommonGallary from 'common/gallary/Gallary'
import FadeAnimation from 'common/fade/FadeAnimation'

export default {
  name: 'DetailBanner',
  data () {
    return {
      showGallary: false,
      imgs: ['https://imgs.qunarzz.com/p/tts1/1612/ab/a482abb41f9ea202.jpg_r_390x260x90_12d2be57.jpg',
        'https://imgs.qunarzz.com/p/tts2/1711/a1/a130d32d15057202.jpg_r_390x260x90_8aeb0d70.jpg']
    }
  },
  methods: {
    handleBannerClick () {
      this.showGallary = true
    },
    handleGallaryClose () {
      this.showGallary = false
    }
  },
  components: {
    CommonGallary,
    FadeAnimation
  }
}
</script>

<style lang="stylus" scoped>
  .banner
    position relative
    overflow hidden
    height 0
    padding-bottom 55%
    .banner-img
      width 100%
    .banner-info
      display flex
      position absolute
      left 0
      right 0
      bottom 0
      line-height 30px
      color #fff
      background-image linear-gradient(top, rgba(0, 0, 0, 0), rgba( 0, 0, 0, 0.8))
      .banner-title
        flex 1
        font-size 16px
        padding 10px
      .banner-number
        height 16px
        line-height 16px
        margin-top 16px
        padding 0 20px
        border-radius 10px
        background rgba(0, 0, 0, 0.4)
      .banner-icon
        font-size 12px
        .arrow-icon
          margin 0 5px
          font-size 12px
</style>
